class Solution(object):
    def findDisappearedNumbers(self, nums):
        """
        :type nums: List[int]
        :rtype: List[int]
        """
        n = len(nums)
        index = 0
        while index < n:
            if nums[index] != 0:
                j = nums[index] - 1
                while nums[j] != 0:
                    temp = nums[j] - 1
                    nums[j] = 0
                    j = temp
            index += 1
        out = []
        for i in range(n):
            if nums[i] != 0:
                out.append(i + 1)
        return out


data = Solution()
nums = [1, 2]
print(data.findDisappearedNumbers(nums))